﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kokomo.Lexical.Expressions;
using Kokomo.Mirror.CliMetadata;

namespace Kokomo.PeInspector.Reflection.Disassembly.Flow
{
	class FieldReferenceEqualityComparer : IEqualityComparer<FieldReferenceExpression>
	{
		static FieldReferenceEqualityComparer()
		{
			Instance = new FieldReferenceEqualityComparer();
		}

		public static FieldReferenceEqualityComparer Instance { get; private set; }

		private FieldReferenceEqualityComparer()
		{
		}

		public bool Equals(FieldReferenceExpression x, FieldReferenceExpression y)
		{
			return MemberEqualityComparer.Equal(x.Field, y.Field);
		}

		public int GetHashCode(FieldReferenceExpression obj)
		{
			return MemberEqualityComparer.Instance.GetHashCode(obj.Field);
		}
	}
}
